import {Http} from "../utils/http";
class theme {

    static thmeA = `t-1`;
    static thmeB = `t-2`;
    static thmeC = `t-3`;
    static thmeD = `t-4`;
    static thmeE = `t-5`;
    static thmeF = `t-6`;

    static themeUrl = `theme/by/names`;

    themes = [];

    async getThemeAll() {
        let themes = await Http.request(theme.themeUrl, {names: `${theme.thmeA},${theme.thmeB},${theme.thmeC},${theme.thmeD},${theme.thmeE},${theme.thmeF}`});
        this.themes = themes.data
    }

    getThemeA() {
        return this.themes.find(t=>t.name === theme.thmeA);
    }

    getThemeB() {
        return this.themes.find(t=>t.name === theme.thmeB);
    }

    getThemeC() {
        return this.themes.find(t=>t.name === theme.thmeC);
    }

    getThemeD() {
        return this.themes.find(t=>t.name === theme.thmeD);
    }

    getThemeE() {
        return this.themes.find(t=>t.name === theme.thmeE);
    }

    getThemeF() {
        return this.themes.find(t=>t.name === theme.thmeF);
    }

    static async getThemeBDetail(){
        return await Http.request(`theme/name/${theme.thmeB}/with_spu`,{});
    }

    static async getThemeDDetail(){
        return await Http.request(`theme/name/${theme.thmeD}/with_spu`,{});
    }

    static async getThemeEDetail(){
        return await Http.request(`theme/name/${theme.thmeE}/with_spu`,{});
    }

}

export {theme}